<!--
 * @Description: 
 * @Author: rendc
 * @Date: 2024-11-13 19:17:10
 * @LastEditors: rendc
 * @LastEditTime: 2024-11-18 14:46:56
-->
<template>
    <div>
      <h2>注册</h2>
      <input type="text" v-model="newUsername" placeholder="用户名" />
      <input type="password" v-model="newPassword" placeholder="密码" />
      <button @click="register">注册</button>
      <button @click="switchToLogin">登录</button>x
    </div>
  </template>
  
  <script>
  export default {   
    data() {
      return {
        newUsername: '',
        newPassword: ''
      };
    },
    methods: {
      register() {
        console.log({ username: this.newUsername, password: this.newPassword });
      },
      switchToLogin() {
        // 切换到登录页面的逻辑，可以通过改 变一个标志位或者使用路由来实现
      }
    }
  };
  </script>






<template>
    <div>{{ sharedData }}</div>
  </template>
  
  <script>
  export default {
    inject: ['sharedData'],
  };
  </script>